package com.hejielife.activeobject1;

/**
 * 2019年8月2日 下午5:15:37
 * 
 * @author hejielife
 * @despribe MakerClientThread
 */
public class MakerClientThread extends Thread {
	private final ActiveObject activeObject;
	private final char fillchar;

	public MakerClientThread(String name, ActiveObject activeObject) {
		super(name);
		this.activeObject = activeObject;
		this.fillchar = name.charAt(0);
	}

	public void run() {
		try {
			for (int i = 0; true; i++) {
				Result result = activeObject.makeString(i, fillchar);
				Thread.sleep(10);
				String value = (String) result.getResultValue();
				System.out.println(Thread.currentThread().getName() + ": value = " + value);
			}
		} catch (InterruptedException e) {
		}
	}
}
